
#include "bsp_led.h"

static void bsp_led_init(void)
{
    //在MX_GPIO_Init中初始化
}

static void bsp_led_on(void)
{
    HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, LED_ON_STATUS);
}

static void bsp_led_off(void)
{
    HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, LED_OFF_STATUS);
}

static void bsp_led_toggle(void)
{
    HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
}

static tsLedDevice g_led_device = {
    .name = "LED1",
    .init = bsp_led_init,
    .on = bsp_led_on,
    .off = bsp_led_off,
    .toggle = bsp_led_toggle
};

void led_init(void)
{
    g_led_device.init();
}

pLedDevice get_led_device(void)
{
    return &g_led_device;
}


